import request from "@/utils/request";

export class Login {
/**
 * 注册接口
 * @param {Function} register
 * @param {string} data.url '/api/register'
 * @param {'POST'} data.method 'POST'
 * @param {object} data
 */
    static async register(data) {
        return request({
            url: '/api/register',
            method: 'POST',
            data
        })
    }
/**
 * 邮箱验证码接口
 * @param {Function} email
 * @param {string} data.url '/api/email/coder'
 * @param {'POST'} data.method 'POST'
 * @param {object} data
 */
    static async email(data) {
        return request({
            url: '/api/email/code',
            method: 'POST',
            data
        })
    }
/**
 * 登录接口
 * @param {Function} login
 * @param {string} data.url '/api/login'
 * @param {'POST'} data.method 'POST'
 * @param {object} data
 */
    static async login(data) {
        return request({
            url: '/api/login',
            method: 'POST',
            data
        })
    }
}

export class Routes {
    static async routes() {
        return request({
            url: '/routes',
            method: 'GET',
        })
    }
}